package com.encapi.framework.handler;

import com.encapi.framework.exception.DecryptBodyException;
import com.encapi.framework.exception.EncryptBodyException;
import org.springframework.http.HttpHeaders;
import javax.servlet.http.HttpServletRequest;

public interface CryptHandler {

    /** 加解密器类型 */
    String getAlgorithm();

    /** 响应体加密 */
    String encrypt(String plainText, HttpServletRequest request, HttpHeaders headers) throws EncryptBodyException;

    /** 请求体解密 */
    String decrypt(String cipherText, HttpServletRequest request, HttpHeaders headers) throws DecryptBodyException;

}
